from selenium import webdriver


class Base:
    _base_url = ""

    def __init__(self, driver: webdriver = None):
        self._driver = ""
        if driver is None:
            self._driver = webdriver.Chrome()
        else:
            self._driver = driver
        if self._base_url != "":
            self._driver.get(self._base_url)
            self._driver.maximize_window()

    def find(self, by, location):
        return self._driver.find_element(by, location)
